package com.meetingshow.weibo.service.util;

import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.meetingshow.common.base.dao.model.QueryStruct;
import com.meetingshow.common.base.service.BaseQueryParasBuilder;
import com.meetingshow.weibo.service.model.WeiboQueryParas;

public class WeiboQueryParasBuilder extends BaseQueryParasBuilder {
    public static QueryStruct weiboQueryBuilder(QueryStruct queryStruct,
            WeiboQueryParas weiboQueryParas) throws Exception {

        builderInit(weiboQueryParas, queryStruct);

        Map<String, Object> exactMap = queryStruct.getExactMap();
        
        if (StringUtils.isNotBlank(weiboQueryParas.getId_e())) {
            exactMap.put(WeiboServiceParas.WEIBO_PO_ID, new Integer(weiboQueryParas.getId_e()));
        }
        
        if (StringUtils.isNotBlank(weiboQueryParas.getUserId_e())) {
            exactMap.put(WeiboServiceParas.WEIBO_PO_USER_ID, new Integer(weiboQueryParas.getUserId_e()));
        }
        
        if (StringUtils.isNotBlank(weiboQueryParas.getWeiboType_e())) {
            exactMap.put(WeiboServiceParas.WEIBO_PO_WEIBO_TYPE, new Integer(weiboQueryParas.getWeiboType_e()));
        }
        
        pageBuilder(queryStruct, weiboQueryParas);
        
        return queryStruct;
    }
}
